package gruppe7.servlets;

import gruppe7.control.ServletController;
import gruppe7.control.Session;
import gruppe7.model.Model;
import gruppe7.model.User;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class Servlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		PrintWriter out = response.getWriter();
		Session session = ServletController.getInstance().getSession(request, response);
		
		User user = session.getUser();
		
		out.println(user.isAdminUser());
		out.println(user.getUsername());
		out.println(user.getUserID());
	}

}
